<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core">


<f:loadBundle basename="properties.messages" var="msg" />

<h:head>

	<title>#{msg.inbox}</title>

</h:head>

<ui:composition template="/WEB-INF/template/templateUser.xhtml">

	<ui:define name="content">
		<f:view locale="#{language.locale}">
			<h:body>



				<center>
					<div class="createMessage">
					
							<h2 align="center">#{msg.createMessage}</h2>
							
								<center>
									<h:form rendered="#{messageController1.noOption}">
										<h3>#{msg.chooseOperation}:</h3>
										<center>
											<h:selectOneMenu id="type"
												value="#{messageController1.currentOption}"
												onchange="submit()"
												valueChangeListener="#{messageController1.getCurrentOptionChanged}">
												<f:selectItems id="operationSelected"
													value="#{messageController1.options}" />
											</h:selectOneMenu>
										</center>
									</h:form>
								</center>
								<center>
									<h:form rendered="#{!messageController1.noOption}">
										<center>
											<h:panelGrid
												rendered="#{messageController1.currentOption==msg.delete_resource}">
												<h3 style="text-align: center;">#{msg.requestDeleteResource}</h3>
												<h:outputText
													rendered="#{messageController1.noResourceToDelete}"
													value="#{msg.noResources}"></h:outputText>
													<br />
												<h:commandButton rendered="#{messageController1.noResourceToDelete}" class="selectRepositoryButton"
															value="#{msg.back}"
															action="#{messageController1.cancelU}" />
												<h:panelGroup
													rendered="#{!messageController1.noResourceToDelete}">
													<h:selectOneMenu id="toDelete"
														value="#{messageController1.currentRes}"
														onchange="submit()"
														valueChangeListener="#{messageController1.getCurrentResourceChanged}">
														<f:selectItems id="selectOption"
															value="#{messageController1.resources}" />
													</h:selectOneMenu>
													<h:outputText value="&nbsp;&nbsp;&nbsp;&nbsp;"></h:outputText>
													<br />
													<br />
													<center>
														<h:commandButton class="selectRepositoryButton" value="OK"
															action="#{messageController1.validate}"
															style="width:40px;" />
														<h:commandButton class="selectRepositoryButton"
															value="#{msg.back}"
															action="#{messageController1.cancelU}" />
													</center>
												</h:panelGroup>
											</h:panelGrid>
										</center>
										<h:panelGrid
											rendered="#{messageController1.currentOption==msg.unlock_resource}">
											<h3 style="text-align: center">#{msg.requestUnlockResource}</h3>
											<h:outputText
												rendered="#{messageController1.noResourceToUnlock}"
												value="#{msg.noLockedResources}"></h:outputText>
											<br />
											<h:commandButton rendered="#{messageController1.noResourceToUnlock}" class="selectRepositoryButton"
														value="#{msg.back}" action="#{messageController1.cancelU}" />
											<h:panelGroup
												rendered="#{!messageController1.noResourceToUnlock}">
												<h:selectOneMenu id="toUnlock"
													value="#{messageController1.currentRes}"
													onchange="submit()"
													valueChangeListener="#{messageController1.getCurrentResourceChanged}">
													<f:selectItems
														value="#{messageController1.resourcesUnlock}" />
												</h:selectOneMenu>
												<h:outputText value="&nbsp;&nbsp;&nbsp;&nbsp;"></h:outputText>
												<br />
												<br />
												<center>
													<h:commandButton class="selectRepositoryButton" value="OK"
														action="#{messageController1.validate}"
														style="width:40px;" />
													<h:commandButton class="selectRepositoryButton"
														value="#{msg.back}" action="#{messageController1.cancelU}" />
												</center>
											</h:panelGroup>
										</h:panelGrid>
										<center>
											<h:panelGroup
												rendered="#{messageController1.currentOption==msg.create_repository}">
												<center>
													<h3 style="text-align: center;">#{msg.createRepository}</h3>
													<h:outputText style="text-align: center;"
														value="#{msg.repNameLabel}"></h:outputText>

													<h:inputText value="#{messageController1.newRepository}" />
													<br /> <br />
													<center>
														<h:commandButton class="selectRepositoryButton" value="OK"
															action="#{messageController1.validate}"
															style="width:40px;" />
														<h:commandButton class="selectRepositoryButton"
															value="#{msg.back}"
															action="#{messageController1.cancelU}" />
													</center>


												</center>
											</h:panelGroup>
										</center>


									</h:form>
									<h:messages style="color:red"></h:messages>
								</center>
								
								


							
						
						<br />
					</div>
				</center>

			</h:body>
		</f:view>
	</ui:define>
</ui:composition>

</html>